package com.itguigu;

import java.util.Scanner;

public class Sushu {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int num = 0;
        for (int i = 2; i <= n; i++) {
            if (i == 2 ||  i == 3 || i == 5 || i == 7){
                num++;
            }
            if (i % 2 != 0 && i % 3 != 0 && i % 5 !=0 && i % 7 != 0){
                num++;
            }
        }
        System.out.println(num);
    }
}
